﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Proggy.Web.Cms.ContentModel;
using Proggy.Web.Cms.Core.ContentModels;
using Proggy.Web.Cms.Core.Seo.Service.Entities;
using Newtonsoft.Json;
using Proggy.Web.Cms.Repositories.ContentModel;
using Proggy.Web.Cms.Repositories.Membership;
using Proggy.Web.Cms.Core.PropertyTypes;
using Proggy.Web.Cms.Core.Configuration.ConfigObjects;

namespace Proggy.Web.Cms.ExampleDomain.ContentModels
{
    [ContentModel("Standard content page", "~/Areas/Proggy/Content/Images/ContentModelIcons/list.png", false, false, "StandardContentPage", "StandardContentPage-1,StandardContentPage-2", "Proggy.Web.Cms.ExampleDomain.Controllers")]
    public class StandardContentPageContentModel : ProggyCoreAddressableContentModelBase
    {
        #region constructors

        public StandardContentPageContentModel(IContentModelTypeRepository cmRepo, IMembershipRepository membRepo) : base(cmRepo, membRepo) { }
        public StandardContentPageContentModel() : base() { }

        #endregion

        #region Seo abstract overrides

        /// <summary>
        /// Site map change frequency
        /// </summary>
        [JsonIgnore]
        public override SiteMapChangeFrequencyEnum SiteMapChangeFrequency
        {
            get { return SiteMapChangeFrequencyEnum.Weekly; }
        }

        /// <summary>
        /// Should appear on site map
        /// </summary>
        [JsonIgnore]
        public override SiteMapPriorityEnum SiteMapPriority
        {
            get { return SiteMapPriorityEnum.ZeroPoint7; }
        }

        /// <summary>
        /// Should appear on site map
        /// </summary>
        [JsonIgnore]
        public override bool ContentShouldAppearOnSiteMap
        {
            get { return true; }
        }

        #endregion

        #region editor properties

        /// <summary>
        /// Content
        /// </summary>
        [ContentModelPropertyType("Content", "Content area", "Content")]
        public DragAndDrop Content { get; set; }


        /// <summary>
        /// Config object
        /// </summary>
        [JsonIgnore]
        public DragAndDropConfigObject ContentConfigObject
        {
            get
            {
                return new DragAndDropConfigObject
                {
                    AllowedParts = "Ex_Domain_Rte,Ex_Domain_Img,Ex_Domain_Html",
                    AreaClass = "ex-dand-area",
                    HeightEm = 40,
                    WidthEm = 60,
                    Stylesheets = new string[] {"~/Content/Css/ex-domain.css" }
                };
            }
        }

        #endregion
    }
}
